<?php

namespace common\models\member;

use Yii;

/**
 * This is the model class for table "{{%member_cashout_log}}".
 *
 * @property int $id
 * @property int $cashout_id 提现申请ID
 * @property int $member_id 会员ID
 * @property int $user_id 用户ID
 * @property int $auditer_id 审核人ID
 * @property string $mark 审核备注
 * @property int $status 审核操作状态
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class MemberCashoutLog extends \common\db\ActiveRecord {

    use \common\traits\Constants;

    use \common\traits\relation\UserData;

    //审核状态
    CONST STATUS_DEFAULT = 0; //等待审核
    CONST STATUS_ACTIVE = 10; //审核通过

    /**
     * {@inheritdoc}
     */

    public static function tableName() {
        return '{{%member_cashout_log}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['cashout_id', 'member_id', 'user_id', 'auditer_id', 'status', 'created_at', 'updated_at'], 'integer'],
            [['mark'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'cashout_id' => '提现申请ID',
            'member_id' => '会员ID',
            'user_id' => '用户ID',
            'auditer_id' => '审核人ID',
            'mark' => '日志内容',
            'status' => '日志操作状态',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }

    public function getAdminer() {
        return $this->hasOne(\common\models\admin\AdminUser::class, ['id' => 'auditer_id']);
    }

}
